<include file="./Application/Admin/View/Public/htmlheader.html" />
<include file="./Application/Admin/View/Public/header.html" />
<include file="./Application/Admin/View/Public/left.html" />

<ol class="breadcrumb">
    <li><a href="/Admin">首页</a></li>
    <li class="active">用户列表</li>
</ol>

<div class="row">
    <div class="col-lg-12">
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <tr class="success">
                    <th>用户名</th>
                    <th>身份</th>
                    <th>用户来源</th>
                    <th>所属权限组</th>
                    <th>昵称</th>
                    <th>用户状态</th>
                    <th>最后登录时间</th>
                    <th>最后登录IP</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                <volist name="userList" id="vo" empty="暂时没有数据">
                    <tr>
                        <td>{$vo.username}</td>
                        <td>
                            <if condition="$vo.permission eq 0">普通用户</if>
                            <if condition="$vo.permission eq 1">主播</if>
                            <if condition="$vo.permission eq 2">管理员</if>
                            <if condition="$vo.permission eq 3">房管</if>
                        </td>
                        <td>
                            <if condition="$vo.from eq 0">站内注册</if>
                            <if condition="$vo.from eq 1">qq</if>
                            <if condition="$vo.from eq 2">weixin</if>
                        </td>
                        <td>{$vo.groupInfo.name}</td>
                        <td>{$vo.nickname}</td>

                        <td>
                            <if condition="$vo.status eq 0"><span class="red">禁用</span></if>
                            <if condition="$vo.status eq 1"><span class="green">开启</span></if>
                        </td>
                        <td>{$vo.lastIp}</td>
                        <td>{$vo.lastTime}</td>
                        <td>{$vo.createTime}</td>
                        <td>
                            <if condition="$vo.username != 'admin'">
                                <if condition="$permission['edit'] eq TRUE">
                                <a href="/Admin/User/edit/id/{$vo.id}" class="btn btn-info btn-xs">编辑</a>
                                </if>
                                <if condition="$permission['permission'] eq TRUE">
                                    <if condition="$vo['permission'] eq 2">
                                        <a href="/Admin/User/permission/id/{$vo.id}" class="btn btn-default btn-xs">分配权限</a>
                                    </if>
                                </if>
                                <if condition="$permission['fordCash'] eq TRUE">
                                <a href="/admin/Gift/fordCash/id/{$vo.id}" class="btn btn-primary btn-xs">提现</a>
                                </if>
                            </if>
                        </td>
                    </tr>
                </volist>
            </table>
            <div class="row">
                <div class="col-lg-3">
                    <if condition="$permission['add'] eq TRUE">
                        <button class="btn btn-primary" data-toggle="modal" data-target="#addTeacher">添加用户</button>
                    </if>
                </div>
                <div class="col-lg-9 text-center">
                    <nav>{$page}</nav>
                </div>
            </div>

        </div>
    </div>
</div>

<!--   添加用户 弹出层   -->
<div class="modal fade" id="addTeacher" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">添加用户</h4>
            </div>
            <form action="/Admin/User/add" method="post">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>用户名：</p></div>
                        <div class="col-lg-9"><input type="text" name="username" class="form-control" /></div>
                    </div>
                    <br />
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>身份：</p></div>
                        <div class="col-lg-9">
                            <select class="form-control" name="permission">
                                <option value="0">普通用户</option>
                                <option value="1">主播</option>
                                <option value="2">管理员</option>
                                <!--<option value="3">房管</option>-->
                            </select>
                        </div>
                    </div>
                    <br />
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>所属权限组：</p></div>
                        <div class="col-lg-9">
                            <select class="form-control" name="userGroup">
                                <volist name="userGroupList" id="vo">
                                    <option value="{$vo.id}">{$vo.name}</option>
                                </volist>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>

<include file="./Application/Admin/View/Public/footer.html" />